﻿<Window x:Class="Shell.Views.ShellView"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
        xmlns:i="http://schemas.microsoft.com/expression/2010/interactions"
        xmlns:ei="http://schemas.microsoft.com/expression/2010/interactivity"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:prism="http://www.codeplex.com/prism"
        xmlns:local="clr-namespace:Shell.Controls"
        Title="Prism Shell" WindowStartupLocation="CenterScreen" Height="620" Width="850"
        Icon="../Images/PnPIcon.ico"
        mc:Ignorable="d" d:DesignHeight="720" d:DesignWidth="900">

    <Window.Resources>
        <!--Style to display an icon and the current item's name in the tab header-->
        <Style x:Key="TabHeaderStyle" TargetType="{x:Type TabItem}">
            <Setter Property="HeaderTemplate">
                <Setter.Value>
                    <DataTemplate>
                        <StackPanel Orientation="Horizontal">
                            <Image Height="20" Width="20" Margin="0,0,2,0" Source="/Shell;component/Images/ItemIcon.png"/>
                            <TextBlock Text="{Binding RelativeSource={RelativeSource AncestorType={x:Type TabItem} }, Path=Content.DataContext.CurrentItem.Name}"
                                       VerticalAlignment="Center"/>
                        </StackPanel>
                    </DataTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="MenuButtonStyle" BasedOn="{x:Null}" TargetType="{x:Type Button}">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Button}">
                        <Grid>
                            <Rectangle Opacity="0" Fill="#66FFFFFF" Stroke="{x:Null}" StrokeThickness="0.5" HorizontalAlignment="Stretch" Margin="2,4,2,4" x:Name="rectangle" VerticalAlignment="Stretch"/>
                            <Path Fill="{x:Null}" Stretch="Fill" Stroke="#7FFFFFFF" StrokeThickness="1" HorizontalAlignment="Left" Margin="0,4,0.5,4" Width="1" Height="18" Grid.RowSpan="1" Data="M-87.28,4 L-87.28,17"/>
                            <Path Fill="{x:Null}" Stretch="Fill" Stroke="#7FFFFFFF" StrokeThickness="1" HorizontalAlignment="Right" Margin="0,4,0.5,4" Width="1" Height="18" Grid.RowSpan="1" Data="M-87.28,4 L-87.28,17"/>
                            <ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="10,4,10,0" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" TextElement.Foreground="LightGray" RecognizesAccessKey="True"/>
                        </Grid>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsFocused" Value="True"/>
                            <Trigger Property="IsDefaulted" Value="True"/>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter Property="Opacity" TargetName="rectangle" Value="0.5"/>
                            </Trigger>
                            <Trigger Property="IsPressed" Value="True">
                                <Setter Property="Opacity" TargetName="rectangle" Value="1"/>
                                <Setter Property="Fill" TargetName="rectangle" Value="#FF000000"/>
                            </Trigger>
                            <Trigger Property="IsEnabled" Value="False"/>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="RegionBorderControlStyle" TargetType="{x:Type local:RegionBorderControl}">
            <Setter Property="Margin" Value="8,2,2,2"/>
            <Setter Property="BorderBrush" Value="#FF425685"/>
            <Setter Property="BorderThickness" Value="2"/>
            <Setter Property="Foreground" Value="#FFD3E2E8"/>
            <Setter Property="FontWeight" Value="Normal"/>
            <Setter Property="FontSize" Value="12"/>
            <Setter Property="FontFamily" Value="Portable User Interface"/>
            <Setter Property="Background">
                <Setter.Value>
                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                        <GradientStop Color="#FFB3B7BA" Offset="0" />
                        <GradientStop Color="#FF60697C" Offset="1" />
                        <GradientStop Color="#FF606F7C" Offset="0.208" />
                    </LinearGradientBrush>
                </Setter.Value>
            </Setter>
        </Style>
    </Window.Resources>

    <Grid x:Name="LayoutRoot">
        <Grid.Background>
            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                <GradientStop Color="#FF85ABCC" />
                <GradientStop Color="#FF344476" Offset="1" />
            </LinearGradientBrush>
        </Grid.Background>
        <Grid.RowDefinitions>
            <RowDefinition Height="100"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" MinWidth="100"/>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="2*"/>
        </Grid.ColumnDefinitions>

        <!-- App Banner -->
        <Canvas x:Name="Banner" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3" RenderTransformOrigin="0.5,0.5">
            <Canvas.RenderTransform>
                <TransformGroup>
                    <ScaleTransform/>
                    <SkewTransform/>
                    <RotateTransform/>
                    <TranslateTransform/>
                </TransformGroup>
            </Canvas.RenderTransform>
            <TextBlock Canvas.Top="5" Canvas.Left="10" Text="Prism" TextWrapping="NoWrap" Foreground="#FF1E2F66" FontSize="48" Opacity="0.7" TextAlignment="Left" FontWeight="Bold" />
            <TextBlock Canvas.Top="10" Canvas.Left="135" Text="4.0" TextWrapping="NoWrap" Foreground="#FF1E2F66" FontSize="20" Opacity="0.7" TextAlignment="Left" FontWeight="Bold" />
            <TextBlock Canvas.Top="20" Canvas.Left="200" Text="QuickStartSolution" TextWrapping="NoWrap" Foreground="#FF4F5E76" FontSize="48" Opacity="0.85" TextAlignment="Left" FontWeight="Normal" RenderTransformOrigin="0.5,0.5">
            	<TextBlock.RenderTransform>
            		<TransformGroup>
            			<ScaleTransform ScaleX="1.25" ScaleY="1.25"/>
            			<SkewTransform/>
            			<RotateTransform/>
            			<TranslateTransform/>
            		</TransformGroup>
            	</TextBlock.RenderTransform>
            </TextBlock>
            <StackPanel Canvas.Top="75" Canvas.Left="15" Orientation="Horizontal" Width="Auto">
                <Button Content="Exit" prism:Click.Command="{Binding ExitCommand}"
                        Style="{DynamicResource MenuButtonStyle}" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"/>
            </StackPanel>
        </Canvas>

        <local:RegionBorderControl Grid.Row="1" Grid.Column="0" RegionName="TopLeftRegion"
                                   Style="{DynamicResource RegionBorderControlStyle}">
            <!-- TopLeft Region : A simple content control -->
            <ContentControl prism:RegionManager.RegionName="TopLeftRegion"
                            VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch"/>
        </local:RegionBorderControl>

        <GridSplitter Grid.Row="2" Grid.Column="0" HorizontalAlignment="Stretch" VerticalAlignment="Center"
                      Height="5" ShowsPreview="true" ResizeDirection="Rows" Background="Transparent"/>

        <local:RegionBorderControl Grid.Row="3" Grid.Column="0" RegionName="BottomLeftRegion"
                                   Style="{DynamicResource RegionBorderControlStyle}">
            <!-- BottomLeft Region : A simple content control -->
            <ContentControl prism:RegionManager.RegionName="BottomLeftRegion"
                            VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch"/>
        </local:RegionBorderControl>

        <GridSplitter Grid.Row="1" Grid.Column="1" Grid.RowSpan="3" HorizontalAlignment="Center" VerticalAlignment="Stretch"
                      Width="5" ShowsPreview="True" ResizeDirection="Columns" Background="Transparent"/>

        <local:RegionBorderControl Grid.Row="1" Grid.Column="2" Grid.RowSpan="3" Margin="2,2,8,2" RegionName="MainRegion"
                                   Style="{DynamicResource RegionBorderControlStyle}">
            <!-- Main Region : A tab control -->
            <TabControl prism:RegionManager.RegionName="MainRegion"
                          VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch" Foreground="#FF546780"
                          ItemContainerStyle="{DynamicResource TabHeaderStyle}">
                <TabControl.Background>
            		<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
            			<GradientStop Color="#FF6999C2" Offset="1"/>
            			<GradientStop Color="#FFEDF2F5"/>
            		</LinearGradientBrush>
                </TabControl.Background>
            </TabControl>
        </local:RegionBorderControl>

    </Grid>

</Window>
